#ifndef PURG_BUFFER_H
#define PURG_BUFFER_H

#include <stdlib.h>  // For size_t

#ifndef PURG_C_INTERFACE_COMPILE
namespace  purg
{
#endif

  class  buffer
  {
    private:
      void    *_buffer;
      size_t   _length;

      buffer () {}
      buffer ( const buffer & ) {}
      buffer &operator = ( const buffer & ) { return *this; }

    public:
      buffer ( size_t  len );
     ~buffer ();
      size_t   copyTo ( void *destination , size_t offset , size_t start , size_t amount , size_t max_len = 0 );
      size_t   xorTo ( void *destination , size_t offset , size_t start , size_t amount , size_t max_len = 0 );

      void  resize ( size_t );

      size_t   size ();

      unsigned char &operator [] ( size_t i );
      operator unsigned char * ();
  };

#ifndef PURG_C_INTERFACE_COMPILE
}
#endif

#include "buffer.inline.h"

#endif
